<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id ="test01"></div>

    <div id ="test02"></div>


    <script>
        //innerHTML：可以识别到html标签
        document.querySelector("#test01").innerHTML = "<h1>今天是9.1号</h1>";
        //innerText：不可以识别html标签，只能当成普通文本玩。
        document.querySelector("#test02").innerText = "<h1>今天是9.1号</h1>";  
    
    </script>






</body>
</html>